Oracle Target Deployment

Prerequisites:

  • Liquibase CLI version 4.33.0 is extracted and available on the deployment host.

  • Oracle JDBC driver is available, preferably under <ARCHIVAL_HOME>\libs.

  • The Archival package is extracted; this location is <ARCHIVAL_HOME>.

  • The target Oracle schema/user exists and can create tables, indexes in target database/schema.

(From Windows):

Set the deployment values and execute below in PowerShell : Make sure to provide actual values for the placeholders below (specified within <>)

# Oracle target deployment - Windows

$archivalHome = '<Archive Distribution Home after extract>'

$liquibase = '<Liquibase CLI path>\liquibase.bat'

$driver = Join-Path $archivalHome 'libs\ojdbc17-23.6.0.24.10.jar'

$oracleUrl = 'jdbc:oracle:thin:@//<HOST>:<PORT>/<SERVICE>'

$oracleUser = '<TARGET_SCHEMA>'

$env:LIQUIBASE_COMMAND_PASSWORD = '<TARGET_SCHEMA_PASSWORD>'

Set-Location $archivalHome

$command = "`"$liquibase`" --url=`"$oracleUrl`" --username=`"$oracleUser`" --driver=oracle.jdbc.OracleDriver --classpath=`"$driver`" --changelog-file=scripts/changelogtargetdatabase.xml update 2>&1"

cmd.exe /d /c $command |

Tee-Object -FilePath (Join-Path $archivalHome 'oracle_archival-target-deployment.log')

if ($LASTEXITCODE -eq 0) { Write-Host 'Oracle target deployment completed successfully.' } else { throw "Oracle target deployment failed. Exit code: $LASTEXITCODE" }

(From Linux/Unix):

Set the deployment values and execute the following commands in a Linux shell. Replace each placeholder enclosed in < > with the appropriate deployment value.

# Oracle target deployment - Linux

ARCHIVAL_HOME='<Archive Distribution Home after extract>'

LIQUIBASE='<Liquibase CLI path>/liquibase'

DRIVER="$ARCHIVAL_HOME/libs/ojdbc17-23.6.0.24.10.jar"

ORACLE_URL='jdbc:oracle:thin:@//<HOST>:<PORT>/<SERVICE>'

ORACLE_USER='<TARGET_SCHEMA>'

export LIQUIBASE_COMMAND_PASSWORD='<TARGET_SCHEMA_PASSWORD>'

cd "$ARCHIVAL_HOME"

set -o pipefail

if "$LIQUIBASE" --url="$ORACLE_URL" --username="$ORACLE_USER" --driver='oracle.jdbc.OracleDriver' --classpath="$DRIVER" --changelog-file='scripts/changelogtargetdatabase.xml' update 2>&1 | tee "$ARCHIVAL_HOME/oracle_archival-target-deployment.log"; then echo 'Oracle target deployment completed successfully.'; else echo 'Oracle target deployment failed. Check oracle_archival-target-deployment.log.' >&2; fi

Once the target table deployment is complete. Verify <ARCHIVAL_HOME>/oracle_archival-target-deployment.log for successful completion.